//    Copyright (C) Kherty.  All rights reserved.
using System;

namespace OpenLS.Spreadsheet.Extensibility
{
    [AttributeUsage(AttributeTargets.Parameter)]
    public class AcceptsRangeFirstCellAttribute : ParameterConverterAttribute
    {
        internal override void ConvertImp(ConversionData data)
        {
            if (data.Value is IRange && typeof(ICell).IsAssignableFrom(data.TargetType))
            {
                data.Result = ((IRange)data.Value).FirstCell;
            }
        }
    }
}